file(GLOB SOURCES sz4/*.cpp szarp_base_common/*.cc szbase/*.cc szbextr/*.cc ipk/*.cc linedmn/*.cc misc/*.cc utils/*.cc)
file(GLOB_RECURSE HEADERS *.h)

protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS protobuf/paramsvalues.proto)

add_library(SzarpLuaParser STATIC
  szarp_base_common/lua_parser_extra.cpp
  szarp_base_common/lua_parser.cpp
)

target_include_directories(SzarpLuaParser
  PUBLIC
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  PRIVATE
    ${CMAKE_SOURCE_DIR}/libSzarp/include
)

add_library(Szarp2 STATIC
  ${PROTO_SRCS} ${PROTO_HDRS}
  ${SOURCES} ${HEADERS}
)

target_include_directories(Szarp2
  PUBLIC
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    ${CMAKE_SOURCE_DIR}/iks/client/include
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${LIBXML2_INCLUDE_DIR}
    ${LUA_INCLUDE_DIR}
)

target_link_libraries(Szarp2
  PUBLIC
    Szarp
  INTERFACE
    SzarpLuaParser
    ${Boost_LIBRARIES}
    ${ZeroMQ_LIBRARIES}
    ${LIBXML2_LIBRARIES}
    ${LIBEVENT_LIBRARIES}
    ${LIBXSLT_LIBRARIES}
    ${LUA_LIBRARIES}
    ${PROTOBUF_LIBRARIES}
    ${Zip_LIBRARIES}
    ${CURL_LIBRARIES}
    ${PYTHON_LIBRARIES}
)

install( DIRECTORY xslt DESTINATION "${SZARP_SHAREDIR}" )
